<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Untitled Document</title>
		<script type="text/javascript">var CTP_WEB_FULLPATH = "../../"</script>
        <script type="text/javascript" src="../../js/jquery/jquery.js">
        </script>
        <script type="text/javascript" src="../../js/jquery/jquery-migrate.js">
        </script>
        <script type="text/javascript" src="../../js/jqueryui/jquery-ui.js">
        </script>
        <script type="text/javascript" src="../../js/ctp/public/jsextend.js">
        </script>
        <script type="text/javascript" src="../../js/ctp/public/ctp.core.js">
        </script>
		<script type="text/javascript" src="../../js/ctp/public/ctp.base.js">
        </script>
		<script type="text/javascript" src="../../js/ctp/public/ctp.ui.component.js">
        </script>
        <script type="text/javascript" src="../../js/ctp/panel/ctp.ui.panel.js">
        </script>
        <script type="text/javascript" src="../../js/ctp/button/ctp.ui.button.js">
        </script>
		<script type="text/javascript" src="../../js/ctp/groupbox/ctp.ui.groupbox.js">
		</script>
		<script type="text/javascript" src="../../js/ctp/gridlayout/ctp.ui.gridlayout.js">
        </script>	
        <script type="text/javascript" src="../../js/ctp/tooltip/ctp.ui.tooltip.js">
        </script>	
        
		<script type="text/javascript" src="../../js/ctp/messagebox/ctp.ui.messagebox.js"></script>
        <link href="../../css/skins/standard/ctp-common.css" rel="stylesheet" type="text/css"/>
        <link href="../../css/panel.css" rel="stylesheet" type="text/css"/>
        <link href="../../css/button.css" rel="stylesheet" type="text/css"/>
		<link href="../../css/groupbox.css" rel="stylesheet" type="text/css"/>
		<link href="../../css/gridlayout.css" rel="stylesheet" type="text/css"/>
		<link href="../../css/messagebox.css" rel="stylesheet" type="text/css"/>
		<link href="../../css/tooltip.css" rel="stylesheet" type="text/css"/>

		<script type="text/javascript">
			$(document).ready(	
				function(){
					var button1 = new ctp.ui.button({
						id:'button1',
						text:'展示tooltip',
						onClick:startTooltip
					});
					var button2 = new ctp.ui.button({
						id:'button2',
						text:'测试',
						onClick:testTooltip
					});
					var tooltip = new ctp.ui.tooltip({
						id:'tooltip1',
						width : '200px',
						height : '200px',
						title : '标题',
						renderTo:'body',
						isVisible:false,
						tip : $('<a href="http://www.icbc.com.cn">链接</a>'),
						positionType:6
					});
					var buttonsLayout = new ctp.ui.gridlayout({
						id:'buttonsLayout',
	                    width: '98%',
	                    cols: 3,
	                    align: 'center',
	                    colSpace: 30,
	                    items: [
						     [{element: button1},{element: button2}]
						]
	                }); 
					var buttonsGroupbox=new ctp.ui.groupbox({
				  	    id: 'buttonsGroupbox',						
						items:[buttonsLayout],
						width:'100%',
						title:'功能测试区'						   
				     });
					new ctp.ui.panel({
	                    title: 'tooltip实例',
	                    collapsible: true,
	                    width: '550px',
	                    height: 'auto',
						align:'center',
						items:[buttonsGroupbox],
	                    renderTo: 'body'
	                });
					function startTooltip(){
						tooltip.setAnimate();
					}
					function testTooltip(){
						var test = [];
						test.push('ctpPackage: '+tooltip.ctpPackage+'\n');
						test.push('getTemplate: '+tooltip.getTemplate({})+'\n');
						test.push('initEvent: '+tooltip.initEvent()+'\n');
						test.push('initSettings: '+tooltip.initSettings+'\n');
						test.push('isContainer: '+tooltip.isContainer+'\n');
						test.push('isHidden: '+tooltip.isHidden+'\n');
						test.push('isNeedRender: '+tooltip.isNeedRender+'\n');
						test.push('isNeedReset: '+tooltip.isNeedReset+'\n');
						test.push('jqDom: '+tooltip.jqDom+'\n');
						test.push('resize: '+tooltip.resize()+'\n');
						test.push('settings: '+tooltip.settings+'\n');
						test.push('type: '+tooltip.type+'\n');
						test.push('version: '+tooltip.version+'\n');
						//test.push('rendered: '+tooltip.rendered+'\n');
						//test.push('renderTo: '+tooltip.renderTo()+'\n');
						//test.push('render: '+tooltip.render()+'\n');
						//test.push('remove: '+tooltip.remove()+'\n');
						alert(test.join(''));

						test = [];
						//test.push('afterInit: '+tooltip.afterInit()+'\n');
						//test.push('destroy: '+tooltip.destroy()+'\n');
						test.push('getCtpWebType: '+tooltip.getCtpWebType()+'\n');
						test.push('getDefaultSettings: '+tooltip.getDefaultSettings()+'\n');
						test.push('getDomId: '+tooltip.getDomId()+'\n');
						test.push('getFnContext: '+tooltip.getFnContext()+'\n');
						test.push('getHeight: '+tooltip.getHeight()+'\n');
						test.push('getId: '+tooltip.getId()+'\n');
						test.push('getInitSettings: '+tooltip.getInitSettings()+'\n');
						test.push('getJqDom: '+tooltip.getJqDom()+'\n');
						test.push('getName: '+tooltip.getName()+'\n');
						test.push('getPkgContext: '+tooltip.getPkgContext()+'\n');
						test.push('getSettings: '+tooltip.getSettings()+'\n');
						test.push('getWidth: '+tooltip.getWidth()+'\n');
						test.push('hide: '+tooltip.hide()+'\n');
						alert('hide')
						//test.push('init: '+tooltip.init()+'\n');
						test.push('removeJqDoms: '+tooltip.removeJqDoms()+'\n');
						test.push('setWidth: '+tooltip.setWidth('400px')+ ' ' + (tooltip.getWidth()==400) +'\n');
						test.push('setHeight: '+tooltip.setHeight('50px')+ ' ' + (tooltip.getHeight()==50) + '\n');
						test.push('setSize: '+tooltip.setSize('400px','100px')+ ' ' + (tooltip.getHeight()==100 && tooltip.getWidth()==400) + '\n');
						test.push('show: '+tooltip.show()+'\n');
						alert('show')
						alert(test.join(''));

						test = [];
						test.push('setPosition: '+tooltip.setPosition()+'\n');
						test.push('setContent: '+tooltip.setContent()+'\n');
						test.push('setAnimatebtn: '+tooltip.setAnimatebtn()+'\n');
						test.push('setVisible: '+tooltip.setVisible(true)+'\n');
						alert('visible')
						test.push('setAnimate: '+tooltip.setAnimate()+'\n');
						//test.push('remove: '+tooltip.remove()+'\n');
						alert(test.join(''));
					}
				});
		</script>
	</head>
	<body>
		<b>ctp.ui.tooltip 实例</b>
        <hr/>
        <br/>  
	</body>
</html>